home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / fileselect.lha / FileSelect / FileSelectExample.asm < prev    next >
Encoding:
Assembly Source File  |  1992-05-14  |  3.4 KB  |  161 lines

  1.         opt    a-,c-,d-,l+,ow-,x-
  2.  
  3. * ---------------------------------------------------------------------------
  4. * -----                     FileSelect V2.0 Example                     -----
  5. * -----                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                  -----
  6. * -----                     AW 01.09.90 - 30.09.90                      -----
  7. * ---------------------------------------------------------------------------
  8.  
  9. *
  10. * Assemble with l+ to 'FileSelectExample.o'
  11. * Use blink to link it with FileSelect.o
  12. * Type blink FileSelectExample.o FileSelect.o TO FileSelectExample
  13. * Or append the source of FileSelect at the end of this source, delete the
  14. * include-lines and assemble it with l-
  15. * You may change the 'incdir'-line 'df0:source/' to the path where the
  16. * 'FileSelect.i'-file is.
  17. *
  18.  
  19.         incdir    ram:include/,df0:source/
  20.         include    exec/exec_lib.i
  21.         include    exec/memory.i
  22.         include    intuition/intuition_lib.i
  23.         include    intuition/intuition.i
  24.         include    intuition/intuitionbase.i
  25.         include    graphics/graphics_lib.i
  26.         include    libraries/dos_lib.i
  27.         include    libraries/dos.i
  28.         include    libraries/dosextens.i
  29.  
  30.         include    FileSelect.i
  31.  
  32.         XREF    FileSelect
  33.         XDEF    _IntuitionBase,_GfxBase,_DOSBase
  34.  
  35. * Start
  36. * ---------------------------------------------------------------------------
  37.  
  38.         SECTION    "FileSelect_Example",CODE
  39.  
  40.         include    user/WBStartup.i
  41.  
  42. _Main        lea    Intuitionname,a1        Libs öffnen
  43.         clr.l    d0
  44.         CALLEXEC OpenLibrary
  45.         move.l    d0,_IntuitionBase
  46.         lea    Graphicsname,a1
  47.         clr.l    d0
  48.         CALLEXEC OpenLibrary
  49.         move.l    d0,_GfxBase
  50.         lea    Dosname,a1
  51.         clr.l    d0
  52.         CALLEXEC OpenLibrary
  53.         move.l    d0,_DosBase
  54.         lea    Screenstruct,a0            Screen öffnen
  55.         CALLINT OpenScreen
  56.         tst.l    d0
  57.         beq    Error_1
  58.         move.l    d0,Screenptr
  59.  
  60. * FileSelect V2.0 aufrufen
  61.  
  62.         lea    FileSelect_struct,a0
  63.         jsr    FileSelect
  64.  
  65. * Ende
  66. * ---------------------------------------------------------------------------
  67.  
  68. _End
  69. Error_2        move.l    Screenptr,a0
  70.         CALLINT CloseScreen
  71. Error_1        move.l    _DosBase,a1            Libs schließen
  72.         CALLEXEC CloseLibrary
  73.         move.l    _GfxBase,a1
  74.         CALLEXEC CloseLibrary
  75.         move.l    _IntuitionBase,a1
  76.         CALLEXEC CloseLibrary
  77.         clr.l    d0                -> CLI
  78.         rts
  79.  
  80. * Data
  81. * ---------------------------------------------------------------------------
  82.  
  83.         SECTION    "FileSelect_Example",DATA
  84.  
  85. * Strukturen
  86.  
  87. * Screen
  88.  
  89. Screenstruct    dc.w    0,0,640,200,2
  90.         dc.b    0,1
  91.         dc.w    $8000                HIRES
  92.         dc.w    CUSTOMSCREEN
  93.         dc.l    Font
  94.         dc.l    Screentitle
  95.         dc.l    0,0
  96.  
  97. * Topaz font
  98.  
  99. Font        dc.l    Font_name
  100.         dc.w    TOPAZ_EIGHTY
  101.         dc.b    FS_NORMAL
  102.         dc.b    FPF_ROMFONT
  103.  
  104. * FileSelect V2.0 struct
  105.  
  106. FileSelect_struct
  107.         dc.w    NFS2_CENTREPOS
  108.         dc.w    NFS2_CENTREPOS
  109.         dc.l    NFS2_DEFAULTTITLE
  110.         dc.l    Pathname
  111.         dc.l    NFS2_NODEFAULT
  112. Screenptr    ds.l    1
  113.         dc.w    NFS2_MAKEDIR!NFS2_DELETE!NFS2_RENAME
  114.         dc.l    Filter_1
  115.         dc.b    NFS2_DEFAULTPEN
  116.         dc.b    NFS2_DEFAULTPEN
  117.         dc.b    NFS2_DEFAULTPEN
  118.         dc.b    NFS2_DEFAULTPEN
  119.         dc.l    0
  120.         dc.l    0
  121.  
  122. Filter_1    dc.l    Filter_2
  123.         dc.b    5,0
  124.         dc.l    String_1
  125.         dc.l    0
  126. String_1    dc.b    ".info"
  127.         even
  128.  
  129. Filter_2    dc.l    FS2F_LASTFILTER
  130.         dc.b    4,0
  131.         dc.l    String_2
  132.         dc.l    0
  133. String_2    dc.b    ".bak"
  134.         even
  135.  
  136. * Strings
  137.  
  138. Intuitionname    dc.b    "intuition.library",0
  139.         even
  140. Graphicsname    dc.b    "graphics.library",0
  141.         even
  142. Dosname        dc.b    "dos.library",0
  143.         even
  144. Font_name    dc.b    "topaz.font",0
  145.         even
  146. Screentitle    dc.b    "FileSelect V2.0 example screen © by André Wichmann",0
  147.         even
  148. Pathname    dc.b    "ram:",0
  149.         even
  150.  
  151. * Buffers
  152. * ---------------------------------------------------------------------------
  153.  
  154.         SECTION    "FileSelect_Example",BSS
  155.  
  156. _IntuitionBase    ds.l    1
  157. _GfxBase    ds.l    1
  158. _DosBase    ds.l    1
  159. OutputBuffer    ds.b    512
  160.  
  161.